package day019.homework.p6;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test {
    public static void main(String[] args) {
        try (FileInputStream fis = new FileInputStream("D:\\img1\\dog.jpg");
             FileOutputStream fos = new FileOutputStream("D:\\img2\\dog.jpg");) {
            byte[] bys = new byte[1024];
            int len;
            while ((len = fis.read(bys)) != -1) {
                fos.write(bys, 0, len);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
